let a = [1, 2, 3]
let b = 'hello'.split('')
console.log(a, a.reverse())
console.log(a, a.length, b, b.length)

let num = [10, 20, 30, 40, 50]
// console.log(num.length)
// for (let i of num.reverse()) {
//     console.log(i)
// }
// for (let i in num.reverse()) {
//     console.log(i, num[i])
// }

//解构赋值
let [x, y, z] = num.reverse()
console.log(x, y, z)
console.log(num)
//数组尾添加元素
num[num.length] = 60
num.push(70, 80, 90, 70, 70, 70)

//数组前添加
num.unshift(1, 2, 3)

//出栈操作
let first = num.pop()
let end = num.shift()

//出栈子数组
let nn = num.splice(1, 3)
console.log(nn)

console.log(num, first, end)
//console.log([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])

// let ss = new Set(num)
// console.log(ss.values())
//num = ss.values();
//删除数组的70元素
let index = num.indexOf(70)
num.splice(index, 1)
console.log(num)


